package com.company.huisuo.biz.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.company.huisuo.base.BaseSingleAdapter
import com.company.huisuo.databinding.ItemMainLeftBinding
import com.company.huisuo.ext.loadImg

/**
 * 首页左上列表
 */
class MainLeftTopAdapter : BaseSingleAdapter<Pair<Int, String>, ItemMainLeftBinding>() {

    override val initViewBinding: (LayoutInflater, ViewGroup, Boolean) -> ItemMainLeftBinding
        get() = ItemMainLeftBinding::inflate

    override fun convert(
        holder: SingleViewHolder<ItemMainLeftBinding>, position: Int, item: Pair<Int, String>?
    ) {
        holder.binding.ivIcon.loadImg(item?.first)
        holder.binding.tvText.text = item?.second ?: ""
    }

}